package tech.aistar.day06.homework02;

import java.util.Date;

/**
 * 本类用来演示:
 * Employee的子类，销售人员，工资由月销售额和提成率决定。
 * 属性：月销售额、提成率
 *
 * @author: success
 * @date: 2021/3/16 9:19 上午
 */
public class SalesEmployee extends Employee{
    private double sales;

    private double rank;//[0.0,1.0)

    public SalesEmployee(){

    }

    public SalesEmployee(String name, Date birthday, double sales, double rank) {
        super(name, birthday);
        this.sales = sales;
        this.rank = rank;
    }

    @Override
    public double getSalary(int month) {
        return super.getSalary(month) + sales*rank;
    }
}
